package service

import (
	ClickHouse "gin/database"
	"gin/model"
)

type FinanceMonthCountHistory struct {
}

// AddAll 批量写入
func (c FinanceMonthCountHistory) AddAll(dataSet []model.FinanceMonthCountHistory) (err error) {
	err = ClickHouse.DB.Create(&dataSet).Error
	return
}

// GetList 查询列表
func (c FinanceMonthCountHistory) GetList(taskType, month string) (res []model.FinanceMonthCountHistory, err error) {
	err = ClickHouse.DB.Model(&model.FinanceMonthCountHistory{}).Where("task_type = ? and work_date = ?", taskType, month).Find(&res).Error
	return
}
